package com.zhang.teachingcommunity_spring.mapper.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Comment {
    @TableId(value = "comment_id",type = IdType.AUTO)
    private Integer commentId;
    private Integer postId;
    private Integer userId;
    private String content;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:SS")
    private Timestamp commentTime;
    private Integer pid;
    @TableField(exist = false)
    private User user;
    @TableField(exist = false)
    private User replyUser;
    @TableField(exist = false)
    private List<Comment> childrenList;
    private Integer originId;
}
